#include <stdio.h>
int main()
{
	int i,n,k;
	scanf("%d",&n);
	if(n>=2001&&n<=2100)
	{
		for(i=2001;i<=n;i++)
		if((i%4==0&&i%100!=0)||i%400==0)
		{printf("%d\n",i);
		k++;}
		
		 
	} if(k==0)
		 printf("None");
	else
	printf("no year");
	return 0;
	
}
